package com.chenliang.service.impl;

import com.chenliang.dao.IPermission;
import com.chenliang.domain.Permission;
import com.chenliang.service.IPermissionService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ProjectName: mavenSSM
 * @Package: com.chenliang.service.impl
 * 作用：
 */
@Service
public class PermissionServiceImpl implements IPermissionService {
    @Autowired
    private IPermission permissiondao;
    @Override
    public List<Permission> findAll(Integer page, Integer pageSize) {
        PageHelper.startPage(page,pageSize);
       return permissiondao.findAll();

    }

    @Override
    public Permission findById(String id) {
        return null;
    }

    @Override
    @Transactional
    public void permissionAdd(Permission permission) {
        permissiondao.permissionAdd(permission);
    }

    @Override
    public Permission findByIdPermission(String id) {
        return permissiondao.findByIdPermission(id);
    }
}
